Integrand size = 15, antiderivative size = 55 \[ \int \frac {\tan ^2(a+i \log (x))}{x^3} \, dx=-\frac {2 e^{-2 i a}}{1+\frac {e^{2 i a}}{x^2}}+\frac {1}{2 x^2}-2 e^{-2 i a} \log \left (1+\frac {e^{2 i a}}{x^2}\right ) \]
[Out]
Time = 0.07 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4591, 455, 45} \[ \int \frac {\tan ^2(a+i \log (x))}{x^3} \, dx=-\frac {2 e^{-2 i a}}{1+\frac {e^{2 i a}}{x^2}}-2 e^{-2 i a} \log \left (1+\frac {e^{2 i a}}{x^2}\right )+\frac {1}{2 x^2} \]
[In]
[Out]
Rule 45
Rule 455
Rule 4591
Rubi steps \begin{align*} \text {integral}& = \int \frac {\left (i-\frac {i e^{2 i a}}{x^2}\right )^2}{\left (1+\frac {e^{2 i a}}{x^2}\right )^2 x^3} \, dx \\ & = -\left (\frac {1}{2} \text {Subst}\left (\int \frac {\left (i-i e^{2 i a} x\right )^2}{\left (1+e^{2 i a} x\right )^2} \, dx,x,\frac {1}{x^2}\right )\right ) \\ & = -\left (\frac {1}{2} \text {Subst}\left (\int \left (-1-\frac {4}{\left (1+e^{2 i a} x\right )^2}+\frac {4}{1+e^{2 i a} x}\right ) \, dx,x,\frac {1}{x^2}\right )\right ) \\ & = -\frac {2 e^{-2 i a}}{1+\frac {e^{2 i a}}{x^2}}+\frac {1}{2 x^2}-2 e^{-2 i a} \log \left (1+\frac {e^{2 i a}}{x^2}\right ) \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(150\) vs. \(2(55)=110\).
Time = 0.13 (sec) , antiderivative size = 150, normalized size of antiderivative = 2.73 \[ \int \frac {\tan ^2(a+i \log (x))}{x^3} \, dx=\frac {1}{2 x^2}-2 i \arctan \left (\frac {\left (1+x^2\right ) \cot (a)}{-1+x^2}\right ) \cos (2 a)+4 \cos (2 a) \log (x)-\cos (2 a) \log \left (1+x^4+2 x^2 \cos (2 a)\right )+\frac {2 \cos (a)-2 i \sin (a)}{\left (1+x^2\right ) \cos (a)-i \left (-1+x^2\right ) \sin (a)}-2 \arctan \left (\frac {\left (1+x^2\right ) \cot (a)}{-1+x^2}\right ) \sin (2 a)-4 i \log (x) \sin (2 a)+i \log \left (1+x^4+2 x^2 \cos (2 a)\right ) \sin (2 a) \]
[In]
[Out]
Time = 1.25 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.93
method | result | size |
risch | \(\frac {1}{2 x^{2}}+\frac {2}{x^{2} \left (1+\frac {{\mathrm e}^{2 i a}}{x^{2}}\right )}-2 \,{\mathrm e}^{-2 i a} \ln \left ({\mathrm e}^{2 i a}+x^{2}\right )+4 \,{\mathrm e}^{-2 i a} \ln \left (x \right )\) | \(51\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.35 \[ \int \frac {\tan ^2(a+i \log (x))}{x^3} \, dx=\frac {5 \, x^{2} e^{\left (2 i \, a\right )} - 4 \, {\left (x^{4} + x^{2} e^{\left (2 i \, a\right )}\right )} \log \left (x^{2} + e^{\left (2 i \, a\right )}\right ) + 8 \, {\left (x^{4} + x^{2} e^{\left (2 i \, a\right )}\right )} \log \left (x\right ) + e^{\left (4 i \, a\right )}}{2 \, {\left (x^{4} e^{\left (2 i \, a\right )} + x^{2} e^{\left (4 i \, a\right )}\right )}} \]
[In]
[Out]
Time = 0.28 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.11 \[ \int \frac {\tan ^2(a+i \log (x))}{x^3} \, dx=- \frac {- 5 x^{2} - e^{2 i a}}{2 x^{4} + 2 x^{2} e^{2 i a}} + 4 e^{- 2 i a} \log {\left (x \right )} - 2 e^{- 2 i a} \log {\left (x^{2} + e^{2 i a} \right )} \]
[In]
[Out]
Exception generated. \[ \int \frac {\tan ^2(a+i \log (x))}{x^3} \, dx=\text {Exception raised: RuntimeError} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 178 vs. \(2 (41) = 82\).
Time = 0.46 (sec) , antiderivative size = 178, normalized size of antiderivative = 3.24 \[ \int \frac {\tan ^2(a+i \log (x))}{x^3} \, dx=-\frac {2 \, \log \left (-x^{2} - e^{\left (2 i \, a\right )}\right )}{\frac {e^{\left (4 i \, a\right )}}{x^{2}} + e^{\left (2 i \, a\right )}} + \frac {4 \, \log \left (x\right )}{\frac {e^{\left (4 i \, a\right )}}{x^{2}} + e^{\left (2 i \, a\right )}} - \frac {2}{\frac {e^{\left (4 i \, a\right )}}{x^{2}} + e^{\left (2 i \, a\right )}} - \frac {2 \, e^{\left (2 i \, a\right )} \log \left (-x^{2} - e^{\left (2 i \, a\right )}\right )}{x^{2} {\left (\frac {e^{\left (4 i \, a\right )}}{x^{2}} + e^{\left (2 i \, a\right )}\right )}} + \frac {4 \, e^{\left (2 i \, a\right )} \log \left (x\right )}{x^{2} {\left (\frac {e^{\left (4 i \, a\right )}}{x^{2}} + e^{\left (2 i \, a\right )}\right )}} + \frac {e^{\left (2 i \, a\right )}}{2 \, x^{2} {\left (\frac {e^{\left (4 i \, a\right )}}{x^{2}} + e^{\left (2 i \, a\right )}\right )}} + \frac {e^{\left (4 i \, a\right )}}{2 \, x^{4} {\left (\frac {e^{\left (4 i \, a\right )}}{x^{2}} + e^{\left (2 i \, a\right )}\right )}} \]
[In]
[Out]
Time = 26.60 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.02 \[ \int \frac {\tan ^2(a+i \log (x))}{x^3} \, dx=-2\,{\mathrm {e}}^{-a\,2{}\mathrm {i}}\,\ln \left (x^2+{\mathrm {e}}^{a\,2{}\mathrm {i}}\right )+4\,{\mathrm {e}}^{-a\,2{}\mathrm {i}}\,\ln \left (x\right )+\frac {\frac {5\,x^2}{2}+\frac {{\mathrm {e}}^{a\,2{}\mathrm {i}}}{2}}{x^4+{\mathrm {e}}^{a\,2{}\mathrm {i}}\,x^2} \]
[In]
[Out]